gulp       = require 'gulp'
minifyCss  = require 'gulp-minify-css'
paths      = require('../config.coffee').paths
rename     = require 'gulp-rename'
sassStream = require '../utils/sassStream.coffee'
rev        = require 'gulp-rev'

gulp.task 'ionic_sass', (done) ->
    gulp.src(paths.ionic_sass)
        .pipe sassStream()
        .pipe minifyCss({keepSpecialComments: 0})
        .pipe rename('vendor.css')
        .pipe gulp.dest(paths.dest)

gulp.task 'ionic_sass-optimize', (done) ->
    gulp.src(paths.ionic_sass)
        .pipe sassStream()
        .pipe minifyCss({keepSpecialComments: 0})
        .pipe rename('vendor.css')
        .pipe rev()
        .pipe gulp.dest(paths.dest)
        .pipe rev.manifest()
        .pipe(gulp.dest('rev/vendor_css'))

